package com.oceansoft.mobile.econsole.modules.message.entity;

public enum MessageType {
    LATEST_NEWS("新闻通知", -3), SYSTEM_NOTI("系统通知", -1), UPDATE_INFO("升级信息", -2), TRAFFIC_INFO("路况信息", 1), WEATHER_INFO("天气信息", 2), OFFENCE_INFO("违章信息", 3), WEIBO_INFO("微博信息", 4), COMMEN_MESSAGE("推送信息", 5), VEHICLE_CHECK("车辆年检", 6), CASE_PROCESS("办件过程", 7), SUBSCRIBE_MESSAGE("消息订阅", 8);
    private String name;
    private int code;

    private MessageType(String name, int code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public static String getTitle(int code) {
        MessageType resultType = null;
        for (MessageType type : values()) {
            if (type.code == code) {
                resultType = type;
                break;
            }
        }
        return null != resultType ? resultType.name : "信息";
    }
}
